<?php
/**
 * Created by JetBrains PhpStorm.
 * User: T420
 * Date: 11/29/12
 * Time: 10:43 PM
 * To change this template use File | Settings | File Templates.
 */
class Models_Menuproduct extends Libs_Model
{
    public function __construct()
    {
        parent::__construct();
    }
    public function getmenuproduct()
    {
        $this->db->connect();
        $list=$this->db->executeQuery("select * from lb_menuproduct");
        $this->db->disconnect();
        return $list;
    }
    public function delmn($id)
    {
        $this->db->connect();
        $list=$this->db->query("delete from lb_menuproduct where pfid='$id'");
        $this->db->disconnect();

    }
    public function insertpf($menuid,$tencn,$trangthaicn)
    {
        $this->db->connect();
        $list=$this->db->query("insert lb_menuproduct(menuid,pfname,status) values('$menuid','$tencn','$trangthaicn')");
        $this->db->disconnect();
    }
    public function checkpf($pfname)
    {
        $this->db->connect();
        $list=$this->db->executeQuery("select * from lb_menuproduct where pfname='$pfname'");
        $this->db->disconnect();
        return $list;
    }
    function updatemenupro($id,$stt)
    {
        $this->db->connect();
        $list=$this->db->query("update lb_menuproduct set status='$stt' where pfid='$id'");
        $this->db->disconnect();
    }
    function getnhomsp()
    {
        $this->db->connect();
        $list=$this->db->executeQuery("select * from lb_menusystem ");
        $this->db->disconnect();
        return $list;
    }
}
